package com.controller;

import com.entity.Person;
import com.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping(value = "person")
public class PersonController {
	
	@Autowired
	private IPersonService personService;
	
	@RequestMapping(value = "list")
	public String queryList(Model model) {
		List<Person> persons = personService.queryList();
		model.addAttribute("persons", persons);
		return "index";
	}
}
